// pages/textsearch/textsearch.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    isFocus:false,
    inputSearch: "",
    recommend: [{
      content: "宠物饲料",
      type: "1"
    }, {
      content: "镜子",
      type: "2"
    }, {
      content: "自行车雨衣外包装",
      type: "1"
    }, {
      content: "橘子皮",
      type: "1"
    }, {
      content: "菠萝蜜核",
      type: "3"
    }, {
      content: "烟头",
      type: "4"
    }, {
      content: "玻璃",
      type: "3"
    }, {
      content: "汽车活性炭",
      type: "4"
    }, {
      content: "花瓣",
      type: "3"
    }, {
      content: "甘蔗皮",
      type: "3"
    }, {
      content: "化妆品",
      type: "2"
    }, {
      content: "香蕉",
      type: "4"
    }, {
      content: "香蕉皮",
      type: "1"
    }, {
      content: "西瓜皮",
      type: "3"
    }, {
      content: "饮料瓶",
      type: "2"
    }, {
      content: "陶瓷制品",
      type: "4"
    }, {
      content: "花盆",
      type: "3"
    }, {
      content: "硬果壳",
      type: "2"
    }, {
      content: "菜叶",
      type: "3"
    }, {
      content: "咖啡渣",
      type: "3"
    }]
  },
  toname2(options) {
    let that = this
    wx.navigateTo({
      url: '/pages/search/search?' + `type=${ options.currentTarget.dataset.value
     }`,

    })
  },
  tapname: function () {
    let that = this
    wx.navigateTo({
      url: '/pages/search/search?' + `type=${that.data.inputSearch}`,

    })
  },
  input(e) {

    this.setData({
      inputSearch: e.detail.value,
      isFocus:true
    })
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    // // console.log(this.data.inputSearch)
    // if (this.data.inputSearch != "") {
    //   wx.navigateTo({
    //     url: '/pages/search/search',

    //   })
    // }
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})